function minArray(numbers: number[]): number {
    let left = 0;
    let right = numbers.length - 1;
    while (left < right) {
        const p = left + Math.floor((right - left) / 2);
        if (numbers[p] < numbers[right]) {
            right = p;
        } else if (numbers[p] > numbers[right]) {
            left = p + 1;
        } else {
            right--;
        }
    }
    return numbers[left];
};